//------------------------------------------------------------------------------
#include "views/prefsdialog.h"
#include "ui_prefsdialog.h"
#include "application.h"

#include <QDebug>
#include <QSettings>
#include <QGraphicsRectItem>
#include <QFontDialog>
//------------------------------------------------------------------------------
PrefsDialog::PrefsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::PrefsDialog) {
	ui->setupUi(this);

	// Loading font color
	if(App.preferences()->contains(CONFIG_KEY_FONT_COLOR))
		ui->m_fontColorButton->colorSelected(QColor(App.preferences()->value(CONFIG_KEY_FONT_COLOR).toString()));

	// Loading font
	if(App.preferences()->contains(CONFIG_KEY_FONT))
		ui->m_fontButton->fontSelected(QFont(App.preferences()->value(CONFIG_KEY_FONT).toString()));

	connect(ui->m_closeButton, SIGNAL(released()), this, SLOT(close()));
}
//------------------------------------------------------------------------------
PrefsDialog::~PrefsDialog(){
	delete ui;
}
//------------------------------------------------------------------------------
void PrefsDialog::on_m_fontColorButton_selectedColorChanged(const QColor &color){
	if(color.isValid())
		App.preferences()->setValue(CONFIG_KEY_FONT_COLOR, color.name());
}
//------------------------------------------------------------------------------
void PrefsDialog::on_m_fontButton_selectedFontChanged(const QFont &font){
	App.preferences()->setValue(CONFIG_KEY_FONT, font.family());
}
//------------------------------------------------------------------------------
void PrefsDialog::on_m_displayNotifChkbx_toggled(bool checked){

}
//------------------------------------------------------------------------------
void PrefsDialog::on_m_exitOnCloseChkbx_toggled(bool checked){

}
//------------------------------------------------------------------------------
void PrefsDialog::on_m_minimizeChkbx_toggled(bool checked){

}
//------------------------------------------------------------------------------
void PrefsDialog::on_m_displayIconChkbx_toggled(bool checked){

}
//------------------------------------------------------------------------------
